<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>Document</title>
	<script type="text/javascript">
	window.onload=function(){
		var shuru=document.getElementById('shuru');
		var tijiao=document.getElementById('tijiao');
		var tishi=document.getElementById('tishi');
	
		tijiao.onclick=function(){
			var neirong=shuru.value;
			var newp=document.createElement('p');
			newp.innerHTML=neirong;

			if(neirong==''){
				alert('内容不能为空');
			}else{
				tishi.appendChild(newp);	
				shuru.value='';
			}	
		}
	}
	
	</script>
	<style type="text/css">
	#box{
		width: 300px;
		height: 500px;
		border: 1px solid #000;
	}
	#tishi{
		width: 300px;
		height: 200px;
		border: 1px solid #000;
		overflow: scroll;
	}
	</style>
</head>
<body>
	<div id="box">
		<div id="tishi">	
		</div>
		<textarea name="" id="shuru" cols="30" rows="10">
			
		</textarea>
		</br>
		<input value="提交" id='tijiao'  type="button">
	</div>
</body>
</html>